{include file="public/header" /}
</head>
<body>
<form class="layui-form layui-form-pane" action="" style="padding: 20px;">
    <input type="hidden" name="admin_id" value="{$dataInfo.admin_id|default=0}">
    <div class="layui-form-item">
        <label class="layui-form-label">管理员登录名</label>
        <div class="layui-input-block">
            <input type="text" name="admin_name" required lay-verify="required"  placeholder="请输入管理员登录名,用于登录" autocomplete="off" class="layui-input" value="{$dataInfo.admin_name|default=''}">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">登录密码</label>
        <div class="layui-input-block">
            <input type="password" name="password"  placeholder="请输入登录密码,用于登录，留空不修改" autocomplete="off" class="layui-input" value="">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">管理员姓名</label>
        <div class="layui-input-block">
            <input type="text" name="nick_name"  required lay-verify="required"   placeholder="请输入管理员姓名" autocomplete="off" class="layui-input" value="{$dataInfo.nick_name|default=''}">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">手机号码</label>
        <div class="layui-input-block">
            <input type="text" name="tel" required lay-verify="required|phone"  placeholder="请输入手机号码，可用于登录" autocomplete="off" class="layui-input" value="{$dataInfo.tel|default=''}">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">管理员角色</label>
        <div class="layui-input-block">
            <select name="group_id" required lay-verify="required" placeholder="请选择角色" >
                <option value="">请选择</option>
                {notempty name="groupList"}
                {volist name="groupList" id="tl"}
                <option value="{$tl.group_id}" {present name="dataInfo.group_id"}{if condition="$tl['group_id'] == $dataInfo['group_id']"}selected{/if}{/present}>{notempty name="$tl.level_name"}{$tl.level_name}&ensp;{/notempty}{$tl.group_name}</option>
                {/volist}
                {/notempty}
            </select>
        </div>
    </div>
    <div class="layui-form-item" pane>
        <label class="layui-form-label">是否冻结</label>
        <div class="layui-input-inline" style="width: 60px;margin-left: 120px;">
            <input type="checkbox" name="is_frozen" lay-skin="switch" value="1" lay-text="是|否" {notempty name="$dataInfo.is_frozen"}checked{/notempty}>
        </div>
        <div class="layui-form-mid layui-word-aux">冻结以后不能登录</div>
    </div>
    <div class="layui-form-item">
        <div class="layui-input-block">
            <button class="layui-btn" type="button" lay-submit lay-filter="formDemo">立即提交</button>
            <button type="reset" class="layui-btn layui-btn-primary">重置</button>
        </div>
    </div>
</form>
</body>
<script>
    layui.use('form', function(){
        var form = layui.form;
        form.render();
        //监听提交
        form.on('submit(formDemo)', function(data){
            post_sub("{:url('Admins/add')}",data.field);
            return false;
        });
    });
</script>
</html>